﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Xyz.Web.Reservation.Models.TripListModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Flight Review
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Flight Review</h1>
    <% using (Html.BeginForm())
       { %>
    <fieldset>
    <table style="width: 100%" cellspacing="0" cellpadding="2">
        <% if(Model != null) { %>
            <tr>
                <td>
                    <table style="background: #f6f6f6;" cellpadding="0" cellspacing="0">
                        <tr>
                            <td style="width:150px; padding:10px;">
                                <div style="font-weight:bold;padding:4px 0;">From</div>
                                <%= Html.DisplayTextFor(t => ViewData.Model.departureAirport) %>
                                <div style="font-weight:bold;padding:4px 0;">Departure Date</div>
                                <%= Html.Label(string.Format("{0:dd-MMM-yyyy (ddd)}", ViewData.Model.Trips[0].TripDate))%>
                            </td>
                            <td style="width:150px; padding:10px;">
                                <div style="font-weight:bold;padding:4px 0;">To</div>
                                <%= Html.DisplayTextFor(t => ViewData.Model.arrivalAirport) %>
                                <% if (ViewData.Model.Trips.Count > 1)
                                   { %>
                                    <div style="font-weight:bold;padding:4px 0;">Return Date</div>
                                    <%= Html.Label(string.Format("{0:dd-MMM-yyyy (ddd)}", ViewData.Model.Trips[1].TripDate))%>
                                <% } %>
                            </td>
                            <td style="width:120px; padding:10px; vertical-align:top;">
                                <div style="font-weight:bold;padding:4px 0;">Class</div>
                                <%= Html.DisplayTextFor(t => ViewData.Model.seatType) %>
                            </td>
                            <td style="width:120px; padding:10px; vertical-align:top;">
                                <div style="font-weight:bold;padding:4px 0;">#Passenger</div>
                                <%= Html.DisplayTextFor(t => ViewData.Model.noOfPassenger) %> Pax
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    <div style="font-weight:bold; font-size:1em;">Total Cost</div>
                    <div style="font-weight:bold; font-size:2em; color:#000;"><%= string.Format("{0:$ #,##0.00}", ViewData.Model.TotalTicketFare)%></div>
                    (includes taxes and surcharge) <br />
                    Additional luggage charges may apply
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <%
            foreach (Xyz.Web.Reservation.Models.TripModel trip in ViewData.Model.Trips) { %>
            <tr>
                <td colspan="2">
                    <% foreach (Xyz.Web.Reservation.Models.ChooseFlightModel chooseFlight in trip.ChooseFlights) { %>
                    <table style="width:100%; background: #f6f6f6;" cellpadding="0" cellspacing="0">
                        <tr>
                            <td style="width: 100px; padding-left: 10px;">
                                <h4><%: Html.DisplayTextFor(t => trip.TripType) %></h4>
                            </td>
                            <td style="width:70px;">
                                <h4><%= chooseFlight.FlightCode %></h4>
                            </td>
                            <td style="width:150px;">
                                <%= Html.Label(string.Format("{0:dd-MMM-yyyy (ddd)  hh:mm tt}", trip.TripDate))%>
                            </td>
                            <td style="width:150px;">
                                <%: Html.DisplayTextFor(f => chooseFlight.DepartureAirport) %> -
                                <%: Html.DisplayTextFor(f => chooseFlight.ArrivalAirport) %>
                            </td>
                            <td style="width:150px;">
                                <b>Total Travel Time : </b>
                                <%= string.Format("{0:#0hrs}", chooseFlight.TravelTime.Hours)%> <%= string.Format("{0:#0mins}", chooseFlight.TravelTime.Minutes)%>
                            </td>
                            <td style="width:70px; text-align:right; padding-right:10px;">
                                <% if (chooseFlight.FlightId == trip.FlightId)
                                    { %>
                                <span style="font-size:large;"><%= string.Format("{0:$ #,##0.00}", chooseFlight.TotalFare)%></span>
                                <% } else { %>
                                <span><%= string.Format("{0:$ #,##0.00}", chooseFlight.TotalFare) %></span>
                                <% }  %>
                            </td>
                        </tr>
                    </table>
                    <% } %>
                </td>
            </tr>
            <% } %>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>                    
        <% } %>
    </table>
    </fieldset>
    <div>
        <input type="submit" value="    Next    " class="yellow_button" />
    </div>
    <br />
    <% } %>
</asp:Content>
